home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / compstol / cmpsttl1.lha / CompositeTool / v1.1.dist / Makefile < prev    next >
Encoding:
Makefile  |  1990-05-08  |  11.7 KB  |  278 lines

  1. #
  2. #******************************************************************************
  3. #*                               NCSA CompositeTool 1.1
  4. #*                           18 April 1990
  5. #* 
  6. #* NCSA CompositeTool 1.1 source code and documentation are in the public
  7. #* domain.
  8. #* Specifically, we give to the public domain all rights for future licensing
  9. #* of the source code, all resale rights, and all publishing rights.
  10. #* 
  11. #* We ask, but do not require, that the following message be included in all
  12. #* derived works:
  13. #* 
  14. #* Portions developed at the National Center for Supercomputing Applications at
  15. #* the University of Illinois at Urbana-Champaign.
  16. #* 
  17. #* THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  18. #* SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  19. #* WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  20. #* 
  21. #******************************************************************************
  22. #
  23. # abstract:    Make file for creating and installing NCSA CompositeTool 1.1
  24. #        There are two make targets: personal and system.
  25. #        Repeated executions of this file are possible.
  26. #
  27. # by:        NCSA Software Tools Group
  28. #
  29. # date:        May 90
  30. #
  31. # notes:     Typing 
  32. #
  33. #            make personal
  34. #
  35. #        will attempt to:
  36. #
  37. #        1. Create a working version of CompositeTool, called
  38. #           compositetool, in this directory.
  39. #        2. Update (create) entries for SunView user defaults
  40. #           database in file $HOME/.defaults. See the macro list
  41. #           in the "Personal Installation" section below to change
  42. #           the value of default options. One should be able to
  43. #           produce a working version without changing anything
  44. #           provided you don't move any files around AND you have
  45. #           enough space AND you execute compositetool from this
  46. #           directory.
  47. #
  48. #        Typing
  49. #
  50. #            make system
  51. #
  52. #        will attempt to:
  53. #
  54. #        1. Create a working version of CompositeTool, called
  55. #           compositetool, and move it and associated files to a
  56. #           system wide directory. See the macro list in the "System
  57. #           Installation" section below to set the appropriate
  58. #           directory.
  59. #        2. Add CompositeTool.d to the master database files in
  60. #           directory /usr/lib/defaults. Check the macro list in
  61. #           "System Installation" section below to change the value
  62. #           of default options.
  63. #
  64. #        IMPORTANT:
  65. #        1. You must be root to "make system".
  66. #        2. After running "make system" it is NO LONGER NECESSARY
  67. #           for a user to execute defaultsedit in SunView to add
  68. #           CompositeTool entries to her private defaults database,
  69. #           normally, $HOME/.defaults. On startup the master database 
  70. #           is searched as required to create a temporary private
  71. #           defaults database.
  72. #        3. Run "make system" only on a standalone or server system.
  73. #
  74. #-------------------------------------------------------------------------------
  75. #
  76. # Installation independent macros:
  77. #
  78. # HDFDIR    -    HDF directory with header files relative to this
  79. #            makefile directory. DO NOT CHANGE!!!
  80. #
  81. HDFDIR = HDF
  82. #
  83. CC = cc
  84. CFLAGS = -O -I$(HDFDIR)
  85. #
  86. #------------------------------------------------------------------------------
  87. #
  88. # Personal Intallation
  89. #
  90. # PCTMPDIR        - C compiler temporary directory. WATCH OUT!
  91. #              This may have to be changed to have enough space to
  92. #              compile successfully! Especially on a Sun-4.
  93. #              NEED
  94. #                ~1.2    - SunOS 4.x - Sun-3
  95. #                ~1.4    - SunOS 4.x - Sun386i
  96. #                ~8.0    - SunOS 4.x - Sun-4
  97. #
  98. PCTMPDIR = /tmp
  99. #
  100. # Values of defaults option macros for "make personal". These need not be
  101. # changed to check out a "personal" version. Go to the "System Installation"
  102. # section for the "system" version.
  103. #
  104. # PInitial_palette_file    - Initial palette file. Part of distribution.
  105. # PLogo_palette_file     - File containing logo image. Part of distribution.
  106. # PLogo_image_file    - File containing logo palette. Part of distribution.
  107. # PFont_panel        - Sun provided screen font. DO NOT CHANGE!!!!
  108. # PFont_panel_button    - Sun provided screen font. DO NOT CHANGE!!!!
  109. # PText_font_dir    - Sun provided default font directory for text font.
  110. #              The value below should be available on all Suns.
  111. #              If the versatec fonts are available then use
  112. #                /usr/lib/vfont
  113. #              CompositeTool will still work if this value is
  114. #              bad, but you will have to replace the value
  115. #                  by the correct one each time you invoke a text
  116. #              frame in CompositeTool.
  117. # PText_font        - Sun provided default font for text font.
  118. #              The value below should be available on all Suns.
  119. #              If the versatec fonts are available then use a
  120. #              font from
  121. #                /usr/lib/vfont
  122. #              CompositeTool will still work if this value is
  123. #              bad, but you will have to replace the value
  124. #                  by the correct one each time you invoke a text
  125. #              frame in CompositeTool.
  126. #
  127. PInitial_palette_file =    pal_initial.raw
  128. PLogo_palette_file =    logo.hdf
  129. PLogo_image_file =    logo.hdf
  130. PFont_panel =        /usr/lib/fonts/fixedwidthfonts/screen.b.12
  131. PFont_panel_button =    /usr/lib/fonts/fixedwidthfonts/screen.r.11
  132. PText_font_dir =    /usr/lib/fonts/fixedwidthfonts
  133. PText_font =        screen.b.12
  134. #
  135. personal:
  136.     @ echo ". . . build personal copy of software - this takes a few minutes"
  137.     @ echo ". . . . . . build HDF library"
  138.     @ (cd $(HDFDIR); make)
  139.     @ echo ". . . . . . build compositetool executable"
  140.     @ $(CC) -o compositetool $(CFLAGS) -temp=$(PCTMPDIR) compositetool.c $(HDFDIR)/libdf.a -lsuntool -lsunwindow -lpixrect -lm
  141.     @ echo ". . . update $$HOME/.defaults"
  142.     @ if [ -f $$HOME/.defaults ]; then exit; \
  143.         else echo "SunDefaults_Version 2" > $$HOME/.defaults; exit; fi
  144.     @ awk '/^\/CompositeTool/ { next } {print} \
  145.          END { \
  146.     print "/CompositeTool/Initial_palette_file\t\"$(PInitial_palette_file)\""; \
  147.     print "/CompositeTool/Logo_palette_file\t\"$(PLogo_palette_file)\""; \
  148.     print "/CompositeTool/Logo_image_file\t\"$(PLogo_image_file)\""; \
  149.     print "/CompositeTool/Font_panel\t\"$(PFont_panel)\""; \
  150.     print "/CompositeTool/Font_panel_button\t\"$(PFont_panel_button)\""; \
  151.     print "/CompositeTool/Text_font_dir\t\"$(PText_font_dir)\""; \
  152.     print "/CompositeTool/Text_font\t\"$(PText_font)\""; }' $$HOME/.defaults > .defaults
  153.     @ cp .defaults $$HOME/.defaults
  154.     @ echo ". . . cleanup files"
  155.     @ rm .defaults
  156.     @ echo ". . . done"
  157. #
  158. #------------------------------------------------------------------------------
  159. # System Installation
  160. #
  161. # SCTMPDIR        - C compiler temporary directory. WATCH OUT!
  162. #              This may have to be changed to have enough space to
  163. #              compile successfully! Especially on a Sun-4.
  164. #              NEED
  165. #                ~1.2    - SunOS 4.x - Sun-3
  166. #                ~1.4    - SunOS 4.x - Sun386i
  167. #                ~8.0    - SunOS 4.x - Sun-4
  168. #              Must be physically on the system you will be
  169. #              installing on.
  170. # TMPDIR        - System temporary directory. WATCH OUT! This may
  171. #              have to be changed to have enough space to create
  172. #              the distribution.
  173. #              NEED
  174. #                  ~1.0 MB - SunOS 4.x
  175. #              Must be physically on the system you will be
  176. #              installing on.
  177. # SYSTEMDIR        - System wide directory where CompositeTool and 
  178. #              associated files will be put. WATCH OUT! You
  179. #              MUST provide this value!
  180. #              NEED
  181. #                ~.3  MB - SunOS 4.x
  182. #              Must be physically on the system you will be
  183. #              installing on.
  184. #              
  185. SCTMPDIR = /tmp
  186. TMPDIR = /tmp
  187. SYSTEMDIR = ?
  188. #
  189. # Values of defaults option macros for "make system".
  190. #
  191. # Initial_palette_file    - Initial palette file. Part of distribution. Put
  192. #              in system wide directory.
  193. # Logo_palette_file     - File containing logo image. Part of distribution.
  194. #              Put in system wide directory.
  195. # Logo_image_file    - File containing logo palette. Part of distribution.
  196. #              Put in system wide directory.
  197. # Font_panel        - Sun provided screen font. DO NOT CHANGE!!!!
  198. # Font_panel_button    - Sun provided screen font. DO NOT CHANGE!!!!
  199. # Text_font_dir        - Sun provided default font directory for text font.
  200. #              The value below should be available on all Suns.
  201. #              If the versatec fonts are available then use
  202. #                /usr/lib/vfont
  203. #              CompositeTool will still work if this value is
  204. #              bad, but you will have to replace the value
  205. #                  by the correct one each time you invoke a text
  206. #              frame in CompositeTool.
  207. # Text_font        - Sun provided default font for text font.
  208. #              The value below should be available on all Suns.
  209. #              If the versatec fonts are available then use a
  210. #              font from
  211. #                /usr/lib/vfont
  212. #              CompositeTool will still work if this value is
  213. #              bad, but you will have to replace the value
  214. #                  by the correct one each time you invoke a text
  215. #              frame in CompositeTool.
  216. #
  217. Initial_palette_file =    $(SYSTEMDIR)/pal_initial.raw
  218. Logo_palette_file =    $(SYSTEMDIR)/logo.hdf
  219. Logo_image_file =    $(SYSTEMDIR)/logo.hdf
  220. Font_panel =        /usr/lib/fonts/fixedwidthfonts/screen.b.12
  221. Font_panel_button =    /usr/lib/fonts/fixedwidthfonts/screen.r.11
  222. Text_font_dir =        /usr/lib/fonts/fixedwidthfonts
  223. Text_font =        screen.b.12
  224. #
  225. system:
  226.     @ id | awk 'BEGIN {FS = "("} { if ( $$1 != "uid=0") \
  227.         { print "Must be root to install system. Make terminated!"; exit -1} }'
  228.     @ echo ". . . build system copy of software - this takes a few minutes"
  229.     @ echo ". . . . . . build HDF library"
  230.     @ rm -rf $(TMPDIR)/$(HDFDIR) 1>/dev/null 2>&1
  231.     @ cp -r $(HDFDIR) $(TMPDIR)
  232.     @ (cd $(TMPDIR)/$(HDFDIR); rm -f *.o *.a) 1>/dev/null 2>&1
  233.     @ (cd $(TMPDIR)/$(HDFDIR); make)
  234.     @ echo ". . . . . . build compositetool executable"
  235.     @ cp compositetool.c $(TMPDIR)
  236.     @ (cd $(TMPDIR); $(CC) -o compositetool $(CFLAGS) -temp=$(SCTMPDIR) compositetool.c $(HDFDIR)/libdf.a -lsuntool -lsunwindow -lpixrect -lm)
  237.     @ echo ". . . install files"
  238.     @ if [ -d $(SYSTEMDIR) ]; then exit; \
  239.         else echo "No such system wide directory (SYSTEMDIR=$(SYSTEMDIR)). Make terminated!"; exit 1 ; fi
  240.     @ install -g bin -m 0644 -o root pal_initial.raw logo.hdf $(SYSTEMDIR)
  241.     @ install -g bin -m 0755 -o root $(TMPDIR)/compositetool $(SYSTEMDIR)
  242.     @ echo ". . . update Master Database defaults file"
  243.     @ awk ' { m = 0 }\
  244.        /^\/\/Initial_palette_file/, /^    \$$Help/ { \
  245.         if ( n == 0 ) { print $$1 "\t\t\"$(Initial_palette_file)\""; n++; } \
  246.         else if ( n == 1 ) { print; n++ } \
  247.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Initial_palette_file)\""; n = 0 }; m = 1} \
  248.        /^\/\/Logo_palette_file/, /^    \$$Help/ { \
  249.         if ( n == 0 ) { print $$1 "\t\t\"$(Logo_palette_file)\""; n++; } \
  250.         else if ( n == 1 ) { print; n++ } \
  251.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Logo_palette_file)\""; n = 0 }; m = 1} \
  252.        /^\/\/Logo_image_file/, /^    \$$Help/ { \
  253.         if ( n == 0 ) { print $$1 "\t\t\"$(Logo_image_file)\""; n++; } \
  254.         else if ( n == 1 ) { print; n++ } \
  255.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Logo_image_file)\""; n = 0 }; m = 1} \
  256.        /^\/\/Font_panel[ \t]/, /^    \$$Help/ { \
  257.         if ( n == 0 ) { print $$1 "\t\t\"$(Font_panel)\""; n++; } \
  258.         else if ( n == 1 ) { print; n++ } \
  259.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Font_panel) - DO NOT CHANGE!\""; n = 0 }; m = 1} \
  260.        /^\/\/Font_panel_button/, /^    \$$Help/ { \
  261.         if ( n == 0 ) { print $$1 "\t\t\"$(Font_panel_button)\""; n++; } \
  262.         else if ( n == 1 ) { print; n++ } \
  263.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Font_panel_button) - DO NOT CHANGE!\""; n = 0 }; m = 1} \
  264.        /^\/\/Text_font_dir/, /^    \$$Help/ { \
  265.         if ( n == 0 ) { print $$1 "\t\t\"$(Text_font_dir)\""; n++; } \
  266.         else if ( n == 1 ) { print; n++ } \
  267.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Text_font_dir) - use /usr/lib/fonts/fixedwidthfonts if not available\""; n = 0 }; m = 1} \
  268.        /^\/\/Text_font[ \t] /, /^    \$$Help/ { \
  269.         if ( n == 0 ) { print $$1 "\t\t\"$(Text_font)\""; n++; } \
  270.         else if ( n == 1 ) { print; n++ } \
  271.         else if ( n == 2 ) { print "\t" $$1 "\t\t\"DEFAULT = $(Text_font) - use a screen font if not available\""; n = 0 }; m = 1} \
  272.           { if ( m == 0) print }' CompositeTool.d > $(TMPDIR)/CompositeTool.d
  273.     @ cp $(TMPDIR)/CompositeTool.d /usr/lib/defaults/CompositeTool.d
  274.     @ echo ". . . cleanup files"
  275.     @ rm -r $(TMPDIR)/$(HDFDIR)
  276.     @ rm -f $(TMPDIR)/compositetool.c $(TMPDIR)/compositetool.o $(TMPDIR)/compositetool $(TMPDIR)/CompositeTool.d
  277.     @ echo ". . . done"
  278.